FLAGS = -std=c++0x -lpthread
DEBUG_FLAGS = -g $(FLAGS)

process_test: process_test.cpp process.cpp process.h
	c++ $< $(FLAGS) -o $@

process_test_dbg: process_test.cpp process_test
	c++ $< $(DEBUG_FLAGS) -o $@

scheduler_test: scheduler_test.cpp scheduler.cpp scheduler.h process.cpp process.h
	c++ $< $(FLAGS) -o $@

scheduler_test_dbg: scheduler_test.cpp scheduler_test
	c++ $< $(DEBUG_FLAGS) -o $@

.PHONY: main, debug, run_rr, run_lottery

main: osMain.cpp process.cpp process.h scheduler.cpp scheduler.h main.cpp
	c++ $< $(FLAGS) -o $@

debug: process_test_dbg scheduler_test_dbg

all: process_test scheduler_test main

run_rr: main
	./main -scheduling RR

run_lottery: main
	./main -scheduling lottery

clean:
	rm main
	rm process_test
	rm scheduler_test
